package org.fount4j.keycloak.chapter4;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class DemoController {
    @GetMapping("/profile")
    public String getProfile() {
        return "Here is your profile";
    }

    @GetMapping("/score")
    public String getScore() {
        return "The score is [100]";
    }

    @PostMapping("/score")
    public String addScore(@RequestBody String score) {
        return "The score is [" + score + "]";
    }

}
